﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Innova.Entites;

namespace Innova.Repository.Mapp  
{
    class CategoriaMap : EntityTypeConfiguration<CATEGORIA>
    {
        public CategoriaMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Descripcion)
                .IsRequired()
                .HasMaxLength(300);

            this.Property(t => t.Imagen)
                .HasColumnType("image");

            // Table & Column Mappings
            this.ToTable("CATEGORIA");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Descripcion).HasColumnName("Descripcion");
            this.Property(t => t.Imagen).HasColumnName("Imagen");
        }
    }
}
